Indirect Testing
^^^^^
**Definition:**
* The Test Method is interacting with the SUT indirectly via another object thereby making the interactions more complex.
**Code Example:**
.. code-block:: java
private final int LEGAL_CONN_MINS_SAME = 30;
public void testAnalyze_sameAirline_LessThanConnectionLimit()
throws Exception {
// setup
FlightConnection illegalConn = createSameAirlineConn( LEGAL_CONN_MINS_SAME - 1);
// exercise
FlightConnectionAnalyzerImpl sut = new FlightConnectionAnalyzerImpl();
String actualHtml = sut.getFlightConnectionAsHtmlFragment( illegalConn.getInboundFlightNumber(),
illegalConn.getOutboundFlightNumber());
// verification
StringBuffer expected = new StringBuffer();
expected.append("");
expected.append("Connection time between flight ");
expected.append(illegalConn.getInboundFlightNumber());
expected.append(" and flight ");
expected.append(illegalConn.getOutboundFlightNumber());
expected.append(" is ");
expected.append(illegalConn.getActualConnectionTime());
expected.append(" minutes.");
assertEquals("html", expected.toString(), actualHtml);
}
**References:**
.. admonition:: Quality attributes
* :octicon:`file-code;1em` - Code Example
* :octicon:`comment-discussion;1em` - Cause and Effect
* :octicon:`graph;1em` - Frequency
* :octicon:`sync;1em` - Refactoring
* `A survey on test practitioners' awareness of test smells `_
* `An Empirical Study into the Relationship Between Class Features and Test Smells `_ :octicon:`graph;1em`
* `An empirical analysis of the distribution of unit test smells and their impact on software maintenance `_ :octicon:`graph;1em`
* `An exploratory study of the relationship between software test smells and fault-proneness `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em`
* `Are test smells really harmful? An empirical study `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em`
* `Automatic generation of smell-free unit tests `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em`
* `Categorising Test Smells `_ :octicon:`graph;1em`
* `Detecting redundant unit tests for AspectJ programs `_
* `Enhancing developers’ awareness on test suites’ quality with test smell summaries `_
* `How are test smells treated in the wild? A tale of two empirical studies `_ :octicon:`graph;1em`
* `Obscure Test `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em`
* `On the Relation of Test Smells to Software Code Quality `_
* `On the diffusion of test smells in automatically generated test code: an empirical study `_
* `On the interplay between software testing and evolution and its effect on program comprehension `_ :octicon:`comment-discussion;1em`
* `Refactoring Test Code `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em`
* `Revisiting Test Smells in Automatically Generated Tests: Limitations, Pitfalls, and Opportunities `_ :octicon:`graph;1em`
* `Scented since the beginning: On the diffuseness of test smells in automatically generated test code `_
* `Test Smell Detection Tools: A Systematic Mapping Study `_
* `TestQ: Exploring Structural and Maintenance Characteristics of Unit Test Suites `_
* `The Relation of Test-Related Factors to Software Quality: A Case Study on Apache Systems `_ :octicon:`graph;1em`
* `Why do builds fail?—A conceptual replication study `_